public class test {
    public static void main(String[] args) {
        MyLinkedList list1 = new MyLinkedList();
        MyLinkedList list2 = new MyLinkedList();
        list1.addLast(1);
        list1.addLast(2);
        list1.addLast(3);
        list1.addLast(3);
        list1.addLast(3);
        list2.addLast(2);
        list2.addLast(3);
        list2.addLast(3);
        ListNode newhead1 = MyLinkedList.merge(list1,list2,true);
        ListNode newhead2 = MyLinkedList.merge(list1,list2,false);
        MyLinkedList.display(newhead1);
        MyLinkedList.display(newhead2);
    }
    public static void main1(String[] args) {
        MyLinkedList list = new MyLinkedList();
        list.addFirst(10);
        list.addFirst(20);
        list.addFirst(30);
        list.addLast(1);
        list.addLast(2);
        list.addLast(3);
        list.addIndex(2,100);
        list.addIndex(2,200);
        list.addIndex(3,300);
        list.display();
        list.remove(1);
        list.remove(1);
        list.remove(1);
        list.display();
        list.reverse();
        list.display();

        ListNode mid = list.middleNode();
        list.display(mid);
    }

}
